package main

import (
	"fmt"
	"gluenet/internal/client"
	"gluenet/pkg/log"
	"os"
	"path/filepath"
)

func main() {
	dir, err := os.Getwd()
	if err != nil {
		panic(err)
	}

	//logCfg := filepath.Join(filepath.Dir(filepath.Dir(dir)), "configs/log.yml")
	//log.Install(logCfg)

	cliCfg := filepath.Join(filepath.Dir(filepath.Dir(dir)), "configs/cli.yml")
	cacheCfg := filepath.Join(filepath.Dir(filepath.Dir(dir)), "configs/cli_cache.yml")

	os.Setenv("GLUE_CONFIG", cliCfg)
	os.Setenv("GLUE_CACHE", cacheCfg)

	if err := client.Cli.Run(os.Args); err != nil {
		log.Fatalf(fmt.Sprintf("run client %v", err))
	}
}
